<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/30
 * Time: 13:31
 */

namespace app\admin\controller;


use app\admin\model\GoodsGroup;

class Group extends Base
{

    public function groupList(){
        return $this->fetch();
    }

    public function groupData($page,$limit){
        $where = input('get.where')?[['group_title','like','%'.trim(input('get.where')).'%']]:'';
        $data = GoodsGroup::where($where)->page($page,$limit)->select()->toArray();
        $count = GoodsGroup::where($where)->count();
        $result = [
            'code'=>0,
            'msg'=>'返回成功',
            'count'=>$count,
            'data'=>$data
        ];
        return json($result);
    }
    public function groupAdd(){
        return $this->fetch();
    }

}